// /public/engine/definition.js

import { Engine } from "../engine";

export const GenderType = {
    male: 'male',
    female: 'female',
    unknown: 'unknown',
};

export const DeviceType = {
    phone: 'phone',
    pad: 'pad',
    desktop: 'desktop',
    web: 'web',
};

export const Definition = {
    // 包名
    appPkgName: 'com.kingstorming.linghang',

    // 模式标识
    isUnitTestMode: false,
    isAutoTestMode: false,
    isWeb: false,

    // 商户接口地址
    baseUrlWithoutService: 'http://linghang.kingstorming.com/api/',
    baseUrl: 'http://metalbiz.kingstorming.com/api/',
    // baseUrl: 'http://192.168.3.4:8884/',
    localSysServiceUrl: 'http://localhost:8883/',

    get isLocalDebugService() {
        return this.baseUrl.includes('localhost');
    },

    // 管理后台地址
    mgrPlatformUrl: 'http://samrtbizadmin.kingstorming.com/',

    // 模板文件地址
    commodityImportTemplate: 'https://samrtbizadmin.kingstorming.com/dapi/latest?name=commodityTemplate',
    customerImportTemplate: 'https://samrtbizadmin.kingstorming.com/dapi/latest?name=customerTemplate',
    supplierImportTemplate: 'https://samrtbizadmin.kingstorming.com/dapi/latest?name=supplierTemplate',

    // 隐私与协议
    privacyPolicy: 'http://samrtbizadmin.kingstorming.com/page/privacy',
    serviceProtocal: 'http://samrtbizadmin.kingstorming.com/page/agree',

    // UI 相关
    readOnlyTitleColor: '#434343',
    isMobileMode: true,

    // 文本限制
    maxTextLenForCommonTextfield: 200,
    maxTextLenForRemark: 300,
    gMaxUserNameLength: 60,
    gMinUserNameLength: 4,
    gMaxPwdLength: 40,
    gMinPwdLength: 4,
    gMaxPhoneNumLength: 30,
    gMaxUnitNameLength: 10,
    gMaxCategoryNameLength: 50,
    gMaxInventoryTypeNameLength: 50,
    gMaxFundInoutTypeNameLength: 50,

    // 分页
    gDefualPageSize: 20,
    gExportMaxPageSize: 1000,

    // 数据量不大的下拉框默认数据量
    gDefualPullDownPageSize: 100,

    // 图片处理
    maxCommodityMgrImgWidth: 720,
    maxCommodityMgrImgHeight: 720,
    commodityMgrImgQuality: 70,

    // 商品图片数量
    maxCommodityImgCount: 1,

    // 其它
    employeeDefaultInitPwd: '',
    topNavigatorBarHeight: 60,

    // 精度
    maxPrecisionLen: 4,
    defaultPrecisionLen: 2,
    gDefaultFundPrecision: 2,
    gMaxFundPrecisionLen: 4,
    get precision() {
        return Engine.getPrecision();
    },
    get fundPrecision() {
        return Engine.getFundPrecision();
    },
    gConstDiscountRatePrecision: 2,
    gConstTaxRatePrecision: 2,
    gConstmerchantChargeNumPrecision: 2,

    // 贵金属精度 
    // 熔耗精度 todo 完善
    get meltLossPrecision() {
        return 4;
    },

    // 成色精度 todo 完善
    get metalGradePrecision() {
        return 9;
    },

    // 损耗精度 todo 完善
    get metalLossPrecision() {
        return 4;
    },



    // 缓存与日志
    gNetworkCacheEnable: true,
    gConstMaxLogFileSize: 1024 * 100,
    gMaxLogFileCount: 10,
    /// 仓库锁库功能关闭
    wareHouseBlockEnabled: true,
    wareHouseEnableFunEnabled: false,
    commonCacheDuration: 15,
    longCacheDuration: 30,

    // 套餐提醒
    pkgRemainNoticeThresholdDay: 3,

};
